package com.weixin.project.Common.Enum;


public enum ModuleType{
    QUESTION(0,"题库"),
    FORUM(1,"论坛");
    private final Integer value;
    private final String filed;
    private ModuleType(Integer value, String filed) {
        this.value = value;
        this.filed = filed;
    }
    public Integer getValue() {
        return value;
    }

    public String getFiled() {
        return filed;
    }

    public static ModuleType codeOf(int code) {
        for (ModuleType moduleType : values()) {
            if (moduleType.getValue() == code) {
                return moduleType;
            }
        }
        System.out.println("非法的code:" + code);
        return null;
    }
}
